//
//  ST_PageView.h
//  ST_BaseMall
//
//  Created by 李宇廷 on 2022/9/13.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN
typedef void(^ClickTitleBlock)(NSInteger);

typedef NS_ENUM(NSInteger, ST_PageViewStyle) {
    /** 底部滑动条风格 */
    ST_PageViewStyleA,
    ST_PageViewStyleB
};

@interface ST_PageView : UIScrollView

/** TitleButton Block */
@property (nonatomic, copy) ClickTitleBlock clickTitleBlock;

/** currentIndexBlock Block */
@property (nonatomic, copy) ClickTitleBlock currentIndexBlock;

// Personalized configuration properties
@property (nonatomic, strong) UIFont *font;
@property (nonatomic, strong) UIColor *selectedColor;
@property (nonatomic, strong) UIColor *unselectedColor;
@property (nonatomic, strong) UIColor *selectedLineColor;
/** 底部长线 */
@property (nonatomic, strong) UIColor *topTabBottomLineColor;
/** item 左边间距 */
@property (nonatomic, assign) CGFloat leftSpace;
/** item 右边间距 */
@property (nonatomic, assign) CGFloat rightSpace;
/** item 间距 */
@property (nonatomic, assign) CGFloat minSpace;
/** item 下标 */
@property (nonatomic, assign) NSInteger defaultSubscript;

@property (nonatomic, assign) ST_PageViewStyle pageViewStyle;

/** default 20. 距离status bar高度 */
@property (nonatomic, assign) CGFloat topSpace;
/** 自定义左右按钮 */
@property (nonatomic, strong) UIButton *leftButton;
@property (nonatomic, strong) UIButton *rightButton;

/**
 default YES.
 */
@property (nonatomic, assign) BOOL isAdapteNavigationBar;
/**
 default NO.
 */
@property (nonatomic, assign) BOOL isAnimated;
/**
 default NO.
 */
@property (nonatomic, assign) BOOL isHiddenTopView;
/**
 default YES.
 */
@property (nonatomic, assign) BOOL isTranslucent;
/**
 default YES , 只有一个页面的时候item是否位于中间位置
 */
@property (nonatomic, assign) BOOL isAverage;
/**
 default YES .
 */
@property (nonatomic, assign) BOOL isShowTopTabBottomLine;
/**
 default YES .
 */
@property (nonatomic, assign) BOOL bodyPageBounces;
/**
 default YES .
 */
@property (nonatomic, assign) BOOL bodyPageScrollEnabled;
/**
 default NO .
 */
@property (nonatomic, assign) BOOL topTabBounces;

@property (strong, nonatomic) UIScrollView   *scrollView;



/**
 Initializes and returns a newly allocated view object with the specified frame rectangle.
 
 @param frame       ...
 @param titles      Some title
 @param controllers Name of some controllers
 @param parameters  You need to set a property called "parameter" for your controller to receive.
 
 @return self
 */
- (instancetype)initWithFrame:(CGRect)frame withTitles:(NSArray *)titles withViewControllers:(NSArray *)controllers withParameters:(NSArray *)parameters;

- (void)changeSelectIndex:(NSInteger)index ;

@end

NS_ASSUME_NONNULL_END
